package com.aic.aicdetactor.common;

import java.io.File;

import android.os.Environment;

public class Setting {


	private String mDataDirector = null;


	public  static final String RootPath="/AIC8600/";

//	public  static final String OriginalJson="OriginalJson/";
//	public  static final String UploadJson="UploadJson/";
//	public  static final String Extral="Extral/";
	
	public  static final String BaseSettingPrams="BaseSetting/";//2016-03-25 liuhg添加
	public  static final String CalibrationRecordFileName= "AICCalibrationRecord.txt";//2016-11-08 liuhg添加
	public Setting() {
		mDataDirector = Environment.getExternalStorageDirectory() + RootPath;

		
		//mDataDirector = "/sdcard" + "/AIC/";
		File destDir = new File(mDataDirector);
		if (!destDir.exists()) {
			destDir.mkdirs();
			destDir = null;
		}
		destDir = new File(mDataDirector + BaseSettingPrams);
		if (!destDir.exists()) {
			destDir.mkdirs();
			destDir = null;
		}

//		destDir = new File(mDataDirector + UploadJson);
//		if (!destDir.exists()) {
//			destDir.mkdirs();
//			destDir = null;
//		}
//
//		destDir = new File(mDataDirector + OriginalJson);
//		if (!destDir.exists()) {
//			destDir.mkdirs();
//			destDir = null;
//		}
//		
//		destDir = new File(mDataDirector + Extral);
//		if (!destDir.exists()) {
//			destDir.mkdirs();
//			destDir = null;
//		}

//		destDir = new File(mDataDirector + Audio);
//		if (!destDir.exists()) {
//			destDir.mkdirs();
//			destDir = null;
//		}
//
//		destDir = new File(mDataDirector + Image);
//		if (!destDir.exists()) {
//			destDir.mkdirs();
//			destDir = null;
//		}
//
//		destDir = new File(mDataDirector + Text);
//		if (!destDir.exists()) {
//			destDir.mkdirs();
//			destDir = null;
//		}
		
	}
//	public void setData_Root_Director(String director){
//		if(director == null){
//			return;
//		}
//		mDataDirector = director;
//	}
	/**
	 * 根据文件类型，返回不同的文件路径
	 * @param fileType 0：拍照图片路径，1：录音文件路径，2：快速记录文件类型
	 * @return
	 */
	public String getData_Media_Director(int fileType){
		String path = null;
		switch(fileType){
//		case CommonDef.FILE_TYPE_PICTRUE:
//			path = mDataDirector +Extral;
//			break;
//		case CommonDef.FILE_TYPE_AUDIO:
//			path = mDataDirector +Extral;
//			break;
//		case CommonDef.FILE_TYPE_TEXTRECORD:
//			path = mDataDirector +Extral;
//			break;
//		case CommonDef.FILE_TYPE_OriginaJson:
//			path = mDataDirector +OriginalJson;
//			break;
//		case CommonDef.FILE_TYPE_UploadJson:
//			path = mDataDirector +UploadJson;
//			break;
		case CommonDef.FILE_TYPE_BaseSetting://2016-03-25 liuhg添加
			path = mDataDirector +BaseSettingPrams;
			break;
		default :
			path = mDataDirector;
			break;
		}
		
		File destDir = new File(path);
		if (!destDir.exists()) {
			destDir.mkdirs();
			destDir = null;
		}
		
		return path;
	}
	public String getData_Root_Director(){
		return mDataDirector;
	}
	
	public String get_CalibrationRecordFile(){//2016-11-08 liuhg添加
		return Environment.getExternalStorageDirectory()+"/" +CalibrationRecordFileName;
	}
	
//	public static String getUpLoadJsonPath(){
//		String path = Environment.getExternalStorageDirectory() + RootPath;
//		return path+UploadJson;
//	}
//	
//	public static String getExtralDataPath(){
//		String path = Environment.getExternalStorageDirectory() + RootPath;
//		return path+Extral;
//	}
	
	
}
